﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Web.Configuration;

namespace DotNETX.Web.Authority
{
    public static class Config
    {
        public static string LoginUrl { get; set; }
        public static bool Rediret2LoginUrl { get; set; }

        static Config()
        {
            LoginUrl = WebConfigurationManager.AppSettings["DotNETX.Web.Authority.LoginUrl"];
            if (LoginUrl == null) LoginUrl = "~/login.ashx?url=";

            string strRediret2LoginUrl = WebConfigurationManager.AppSettings["DotNETX.Web.Authority.Rediret2LoginUrl"];
            if (strRediret2LoginUrl != null && new List<string>() { "false", "0" }.Contains(strRediret2LoginUrl.Trim().ToLower())) Rediret2LoginUrl = false ;
            else Rediret2LoginUrl = true;
        }
    }
}
